package org.karelun.gef.parts;

import org.eclipse.draw2d.BendpointConnectionRouter;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.PolylineDecoration;
import org.eclipse.draw2d.geometry.PointList;

public class DependencyConnectionEditPart extends CustomAbstractConnectionEditPart{

	protected IFigure createFigure(){
		PolylineConnection connection = new PolylineConnection();
		connection.setConnectionRouter(new BendpointConnectionRouter());
//		PolylineConnection connection=(PolylineConnection)super.createFigure();

		PolylineDecoration decoration=new PolylineDecoration();
		PointList decorationPointList = new PointList();
		decorationPointList.addPoint(0, 0);   
		decorationPointList.addPoint(-2, 2);
		decorationPointList.addPoint(0, 0);
		decorationPointList.addPoint(-2, -2);
		
		decoration.setTemplate(decorationPointList);
		
		connection.setTargetDecoration(decoration);
		connection.setLineStyle(3);	
		connection.setLineWidth(2);
		return connection;						
	}
	
}
